package console

import (
	"gitee.com/dhcy/tencent_ddns/conf"
	"github.com/spf13/cobra"
)

// Init 初始化console
func Init() error {
	cmd := cobra.Command{}

	flags := cmd.PersistentFlags()
	flags.StringVar(&conf.Token, "token", "1212xxx.xx2.xx", "token 1212xxx.xx2.xx")
	flags.StringVar(&conf.Domain, "domain", "test.com", "domain test.com")
	flags.StringVar(&conf.SubDomain, "subDomain", "www;about;dev", "subDomain www;about;dev.... more subDomain")

	_, err := cmd.ExecuteC()
	return err
}
